/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Message;
import java.io.Serializable;


/**
 *
 * @author liyuchen
 */
public class LoginMessage implements Serializable{
    /* enter from client side */
    public String username;
    public String password;
    
    /* enter from server side */
    public boolean loginSucessful;
    public String loginErrorMsn;
    public int securitylevel;
    
    private static final long serialVersionUID = 6529685098267757690L;
    
    public void SetLoginResult(boolean loginStatus, int status){
        this.loginSucessful = loginStatus;
        switch(status){
            case 0:
                this.loginErrorMsn = "Login Successful! From Server\n";
                break;
            case 1:
                this.loginErrorMsn = "Server too busy. Try later.\n";
                break;
            case 2:
                this.loginErrorMsn = "Login Info Database Fail!\n";
                break;
            case 3:
                this.loginErrorMsn = "Cannot create user directory in server!\n";
                break;
                
        }
    }
}
